package org.ykh.srb.core.bean;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.ykh.srb.core.pojo.entity.DictEntity;
import org.ykh.srb.core.pojo.entity.UserAccountEntity;
import org.ykh.srb.core.pojo.entity.UserBindEntity;

/**
 * @author ykh
 */
@Configuration
@Slf4j
public class ProfileTestBean {
    @Bean
    @Profile("default")//事实证明只有没有指定profile.active，才会被激活
    public DictEntity dictEntity(){
        log.warn("default--------------------");
        return new DictEntity();
    }


    @Bean
    @Profile("dev")//只有指定profile.active为dev才被激活
    public UserBindEntity userBindEntity(){
        log.warn("dev--------------------");
        return new UserBindEntity();
    }

    @Bean//任意情况下有效
    public UserAccountEntity userAccountEntity(){
        log.warn("none--------------------");
        return new UserAccountEntity();
    }
}
